package com.base.boot.demo.service.impl;

import com.base.boot.demo.neo4j.UserRepository;
import com.base.boot.demo.service.Neo4jDemoService;
import com.base.boot.demo.neo4j.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class Neo4jDemoServiceImpl implements Neo4jDemoService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public User add(User user) {
        return userRepository.save(user);
    }

    @Override
    public User get(Long id) {
        return userRepository.findById(id).orElse(null);
    }
}
